﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	CreateItems
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <link href="../../Content/template.css" rel="stylesheet" type="text/css" />
    <link href="../../Content/validationEngine.jquery.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.validationEngine-vi.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.validationEngine.js" type="text/javascript"></script>
<script>
    function check() {
        var tenvp = document.getElementById("txtten").value;
        var trangthaico = document.getElementById("txttrangthaico");
        var trangthaikhong = document.getElementById("txttrangthaikhong");
        var soluong = document.getElementById("soluong").value;
        if ((trangthaico.checked == false) && (trangthaikhong.checked == false)) {
            alert("Bạn phải chọn một trạng thái");
            return false;
        }
      

    }
</script>
 <script>
     jQuery(document).ready(function () {
         // binds form submission and fields to the validation engine
         jQuery("#formID").validationEngine();
     });
</script>

   <link href="../../Content/Admin/control.css" rel="stylesheet" type="text/css" />
      <form method="post" action="/Items/CreateItems" id="formID">
    <table width="100%">
    <tr>
   <td>Tên vật phẩm: </td><td><input type="text" name="ItemName" id="txtten" onkeyup="return check();"class="validate[required]" /></td>
    </tr>
    <tr>
    <td>Trạng thái</td>
    <td>
    <input type="radio" name="IsBind" id="rditrangthaico" onkeyup="return check();" value="có" />Có
    <input type="radio" name="IsBind" id="rditrangthaikhong" onkeyup="return check();" value="không" />Không
    </td></tr>
    <tr>
   <td>Số lượng: </td><td><input type="text" name="Quantity" id="txtsoluong" onkeyup="return check();" class="validate[required, custom[integer]]"/></td>
    </tr>
    </table>
    <div class="Control">
    <input type="submit" value="Thêm" class="vadd" onclick="return check()";/>
    <%:Html.ActionLink("Quay lại", "GetItems", "Items", new { @class = "vback" })%>
    </div>
    </form>
</asp:Content>
